package remato.domain.common;

import java.util.Date;
import java.util.Set;

import remato.common.domain.helpers.Nameable;


/**
 * 
 * @version $Id: Requirement.java,v 1.1 2006-01-23 09:27:22 petterei Exp $
 */
public interface Requirement extends Nameable {

	public Long getBusinessId();

    public Category getCategory();

    /**
	 * This can only be used for read operations. Adding and removing 
	 * Stakeholders should be done by calling explicit methods.
	 * 
	 * @return A clone of the Requirement's list of Stakeholders
	 */
    public Set<Stakeholder> getStakeholders();
    /**
     * @return <tt>true</tt> if this set did not already contain the specified
     *         element.
     */
    public boolean addStakeholder(Stakeholder stakeholder);
	/**
     * @return <tt>true</tt> if this collection changed as a result of the
     *         call
	 */
    public boolean removeStakeholder(Stakeholder stakeholder);

    /**
	 * This can only be used for read operations. Adding and removing 
	 * PropertyValues should be done by calling explicit methods.
	 * 
	 * @return A clone of the Requirement's list of PropertyValues
	 */
    public Set<PropertyValue> getPropertyValues();
    /**
     * Sets the requirement's value for the property-value's property
     * definition. 
     * 
     * @param value The value to be set at the requirement.
     * @return previous value associated with specified key, or <tt>null</tt>
     *	       if there was no mapping for key.  (A <tt>null</tt> return can
     *	       also indicate that the map previously associated <tt>null</tt>
     *	       with the specified key, if the implementation supports
     *	       <tt>null</tt> values.)
     */
    public PropertyValue putPropertyValue(PropertyValue value);
    public PropertyValue getPropertyValue(PropertyDef def);
    public PropertyValue getPropertyValue(String defLabel);

    public Integer getPriority();
    public void setPriority(Integer priority);
    
    public Integer getStatus();
    public void setStatus(Integer status);

    public String getVersion();
    public Date getSubmittedDate();
    public Date getLastUpdatedDate();
    
    public Stakeholder getAssignedTo();
    public void setAssignedTo(Stakeholder author);

    public Stakeholder getReporterOrOwner();
    public void setReporterOrOwner(Stakeholder stakeholder);

	/**
	 * This can only be used for read operations. Adding and removing 
	 * linked Requirements should be done by calling explicit methods.
	 * 
	 * @return A clone of the Requirement's list of linked Requirements
	 */
    public Set<Requirement> getLinkedToRequirements();
    /**
     * 
     * @param requirement
     * @return <tt>true</tt> if this set did not already contain the specified
     *         element.
     */
    public boolean addLinkedToRequirement(Requirement requirement);
	/**
     * @return <tt>true</tt> if this collection changed as a result of the
     *         call
	 */
    public boolean removeLinkedToRequirement(Requirement requirement);
}
